<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: lainiao
  Date: 2021/4/17
  Time: 21:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试Request作用域</title>
</head>
<body>
    <h2>测试Request作用域</h2>
    <%-- 如果要在jsp中写Java代码，需要写在脚本段中 --%>
    <%
        // 获取域对象
        // 浏览器地址栏不能直接写 本jsp文件名，因为作用域数据是在”/rs“下设置的（但仅限于本次展示）
        String  name = (String) request.getAttribute("name");
        System.out.println("name：" + name);
        Integer age = (Integer) request.getAttribute("age");
        System.out.println("age：" + age);
        List<String> list = (List<String>) request.getAttribute("list");
        System.out.println("list：" + list.toString());
    %>
</body>
</html>
